# -*- coding: UTF-8 -*-
# Project : bio_tc
# File : zgzfcrawl.py
# IDE : PyCharm
# Author : 博科（鑫贝西）田聪
# Date : 2021/11/29 13:39

import time
import datetime
from dateutil.relativedelta import relativedelta

from spider.ccgpSpider import zgzfcgwSpider

if __name__ == '__main__':

    while True:# .strftime('%Y:%m:%d')
        new = datetime.datetime.now()
        one_old_year = new-relativedelta(years = int(1))
        two_old_year = new-relativedelta(years = int(2))
        zgzfcgwSpider().start_request(one_old_year.strftime('%Y:%m:%d'), new.strftime('%Y:%m:%d'))
        time.sleep(100)
        zgzfcgwSpider().start_request(two_old_year.strftime('%Y:%m:%d'), one_old_year.strftime('%Y:%m:%d'))
        time.sleep(600)